.class public Lcom/instagram/creation/video/j/j;
.super Ljava/lang/Object;
.source "VideoImportUtil.java"


# direct methods
.method public static a(Ljava/lang/String;Lcom/instagram/creation/video/g/a;)Landroid/os/Bundle;
    .locals 4
    .parameter
    .parameter

    .prologue
    .line 65
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 66
    const-string v1, "ARGUMENT_IMPORT_PATH"

    invoke-virtual {p1}, Lcom/instagram/creation/video/g/a;->c()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 67
    const-string v1, "pendingMediaKey"

    invoke-virtual {v0, v1, p0}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 68
    const-string v1, "ARGUMENT_IMPORT_DURATION_MS"

    invoke-virtual {p1}, Lcom/instagram/creation/video/g/a;->a()J

    move-result-wide v2

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Bundle;->putLong(Ljava/lang/String;J)V

    .line 69
    return-object v0
.end method

.method public static a(Landroid/content/Context;I)Lcom/instagram/pendingmedia/model/c;
    .locals 3
    .parameter
    .parameter

    .prologue
    .line 98
    invoke-static {}, Ljava/lang/System;->nanoTime()J

    move-result-wide v0

    invoke-static {v0, v1}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/instagram/pendingmedia/model/c;->b(Ljava/lang/String;)Lcom/instagram/pendingmedia/model/c;

    move-result-object v0

    .line 99
    const/4 v1, 0x0

    const/4 v2, -0x1

    invoke-static {v1, v2, p0}, Lcom/instagram/creation/video/j/k;->a(Ljava/lang/String;ILandroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    .line 102
    invoke-virtual {v0, v1}, Lcom/instagram/pendingmedia/model/c;->i(Ljava/lang/String;)V

    .line 103
    invoke-virtual {v0, p1}, Lcom/instagram/pendingmedia/model/c;->a(I)V

    .line 105
    return-object v0
.end method

.method public static a(Landroid/content/Context;Landroid/net/Uri;)Ljava/lang/String;
    .locals 6
    .parameter
    .parameter

    .prologue
    const/4 v2, 0x0

    .line 149
    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    move-object v1, p1

    move-object v3, v2

    move-object v4, v2

    move-object v5, v2

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    .line 150
    if-nez v1, :cond_0

    .line 151
    invoke-virtual {p1}, Landroid/net/Uri;->getPath()Ljava/lang/String;

    move-result-object v0

    .line 160
    :goto_0
    return-object v0

    .line 153
    :cond_0
    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    .line 154
    const-string v0, "_data"

    invoke-interface {v1, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    .line 155
    if-gez v0, :cond_1

    .line 156
    const-string v0, "video_invalid_url"

    goto :goto_0

    .line 158
    :cond_1
    invoke-interface {v1, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    .line 159
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    goto :goto_0
.end method

.method private static a()V
    .locals 1

    .prologue
    .line 49
    sget v0, Lcom/facebook/ba;->video_import_unsupported_file_type:I

    invoke-static {v0}, Lcom/instagram/n/j;->a(I)V

    .line 50
    return-void
.end method

.method public static a(Landroid/app/Activity;)V
    .locals 3
    .parameter

    .prologue
    .line 121
    const-string v0, "VideoImportUtil"

    const-string v1, "Remote file accessed. Not supporting for now. Finishing activity."

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 122
    invoke-virtual {p0}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    sget v1, Lcom/facebook/ba;->video_import_remote_url:I

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    .line 124
    invoke-virtual {p0}, Landroid/app/Activity;->finish()V

    .line 125
    return-void
.end method

.method public static a(Landroid/support/v4/app/r;Ljava/lang/String;Lcom/instagram/creation/video/g/a;ZZ)V
    .locals 3
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 110
    new-instance v0, Lcom/instagram/e/b/a/a;

    invoke-direct {v0, p0}, Lcom/instagram/e/b/a/a;-><init>(Landroid/support/v4/app/r;)V

    .line 111
    invoke-static {p1, p2}, Lcom/instagram/creation/video/j/j;->a(Ljava/lang/String;Lcom/instagram/creation/video/g/a;)Landroid/os/Bundle;

    move-result-object v1

    .line 112
    const-string v2, "directShare"

    invoke-virtual {v1, v2, p4}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    .line 113
    new-instance v2, Lcom/instagram/creation/video/f/ae;

    invoke-direct {v2}, Lcom/instagram/creation/video/f/ae;-><init>()V

    invoke-virtual {v0, v2, v1}, Lcom/instagram/e/b/a/a;->a(Landroid/support/v4/app/Fragment;Landroid/os/Bundle;)Lcom/instagram/e/b/a/a;

    .line 114
    if-nez p3, :cond_0

    .line 115
    invoke-virtual {v0}, Lcom/instagram/e/b/a/a;->f()Lcom/instagram/e/b/a/a;

    .line 117
    :cond_0
    invoke-virtual {v0}, Lcom/instagram/e/b/a/a;->e()V

    .line 118
    return-void
.end method

.method private static a(J)Z
    .locals 2
    .parameter

    .prologue
    .line 33
    const-wide/16 v0, 0xbb8

    cmp-long v0, p0, v0

    if-ltz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static a(Lcom/instagram/creation/video/g/a;)Z
    .locals 4
    .parameter

    .prologue
    const/4 v0, 0x0

    .line 73
    invoke-virtual {p0}, Lcom/instagram/creation/video/g/a;->c()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/instagram/creation/video/j/j;->a(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 74
    invoke-static {}, Lcom/instagram/creation/video/j/j;->a()V

    .line 94
    :goto_0
    return v0

    .line 78
    :cond_0
    invoke-virtual {p0}, Lcom/instagram/creation/video/g/a;->a()J

    move-result-wide v1

    invoke-static {v1, v2}, Lcom/instagram/creation/video/j/j;->c(J)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 79
    invoke-static {}, Lcom/instagram/creation/video/j/j;->d()V

    goto :goto_0

    .line 83
    :cond_1
    invoke-virtual {p0}, Lcom/instagram/creation/video/g/a;->a()J

    move-result-wide v1

    invoke-static {v1, v2}, Lcom/instagram/creation/video/j/j;->a(J)Z

    move-result v1

    if-nez v1, :cond_2

    .line 84
    invoke-static {}, Lcom/instagram/creation/video/j/j;->b()V

    goto :goto_0

    .line 88
    :cond_2
    invoke-virtual {p0}, Lcom/instagram/creation/video/g/a;->a()J

    move-result-wide v1

    invoke-static {v1, v2}, Lcom/instagram/creation/video/j/j;->b(J)Z

    move-result v1

    if-nez v1, :cond_3

    .line 89
    const-string v1, "Import long clip"

    invoke-virtual {p0}, Lcom/instagram/creation/video/g/a;->a()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/instagram/g/c;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 90
    invoke-static {}, Lcom/instagram/creation/video/j/j;->c()V

    goto :goto_0

    .line 94
    :cond_3
    const/4 v0, 0x1

    goto :goto_0
.end method

.method private static a(Ljava/lang/String;)Z
    .locals 1
    .parameter

    .prologue
    .line 45
    if-eqz p0, :cond_0

    const-string v0, ".mp4"

    invoke-virtual {p0, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static a([DI)[D
    .locals 14
    .parameter
    .parameter

    .prologue
    const/4 v9, 0x0

    .line 129
    rem-int/lit8 v0, p1, 0x2

    if-nez v0, :cond_0

    div-int/lit8 v0, p1, 0x2

    :goto_0
    new-array v11, v0, [D

    move v10, v9

    .line 131
    :goto_1
    if-ge v10, p1, :cond_2

    .line 132
    int-to-double v6, p1

    .line 133
    array-length v0, p0

    add-int/lit8 v0, v0, -0x1

    aget-wide v2, p0, v0

    .line 135
    array-length v12, p0

    move v8, v9

    :goto_2
    if-ge v8, v12, :cond_1

    aget-wide v0, p0, v8

    .line 137
    int-to-double v4, v10

    sub-double/2addr v4, v0

    invoke-static {v4, v5}, Ljava/lang/Math;->abs(D)D

    move-result-wide v4

    .line 138
    cmpg-double v13, v4, v6

    if-gez v13, :cond_3

    move-wide v2, v4

    .line 135
    :goto_3
    add-int/lit8 v4, v8, 0x1

    move v8, v4

    move-wide v6, v2

    move-wide v2, v0

    goto :goto_2

    .line 129
    :cond_0
    div-int/lit8 v0, p1, 0x2

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 143
    :cond_1
    div-int/lit8 v0, v10, 0x2

    aput-wide v2, v11, v0

    .line 131
    add-int/lit8 v0, v10, 0x2

    move v10, v0

    goto :goto_1

    .line 145
    :cond_2
    return-object v11

    :cond_3
    move-wide v0, v2

    move-wide v2, v6

    goto :goto_3
.end method

.method private static b()V
    .locals 1

    .prologue
    .line 53
    sget v0, Lcom/facebook/ba;->video_import_too_short:I

    invoke-static {v0}, Lcom/instagram/n/j;->a(I)V

    .line 54
    return-void
.end method

.method private static b(J)Z
    .locals 2
    .parameter

    .prologue
    .line 37
    const-wide/32 v0, 0x927c0

    cmp-long v0, p0, v0

    if-gtz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private static c()V
    .locals 1

    .prologue
    .line 57
    sget v0, Lcom/facebook/ba;->video_import_too_long:I

    invoke-static {v0}, Lcom/instagram/n/j;->a(I)V

    .line 58
    return-void
.end method

.method private static c(J)Z
    .locals 2
    .parameter

    .prologue
    .line 41
    const-wide/16 v0, 0x0

    cmp-long v0, p0, v0

    if-gtz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private static d()V
    .locals 1

    .prologue
    .line 61
    sget v0, Lcom/facebook/ba;->video_import_remote_url:I

    invoke-static {v0}, Lcom/instagram/n/j;->a(I)V

    .line 62
    return-void
.end method
